home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2006 April / PCnet 2006-06.4.iso / shareware / nmsetup.exe / WebServer / web / glossary.php < prev    next >
Encoding:
PHP Script  |  2006-05-01  |  2.1 KB  |  55 lines

  1. <?php
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // <!--Copyright (c) 2005 Pure Networks Inc.  All rights reserved.-->
  4. ////////////////////////////////////////////////////////////////////////////////
  5. //
  6. // Build: 3.0.6121.0 (Stable)
  7. // $Revision: #1 $
  8. //
  9.     $sNavLocation = "glossary";
  10.     require "_util.php";
  11.     require "_config.php";
  12.     require "_glossary.php";
  13.  
  14.     // PHP does crappy case insensitive sorts, so we make a case insensitive (CI array that matches the real array)
  15.     foreach ($arGlossary as $itmGlossary)
  16.     {
  17.         $arGlossaryCI[strtolower($itmGlossary[0])][0] = strtolower($itmGlossary[0]);
  18.         $arGlossaryCI[strtolower($itmGlossary[0])][1] = strtolower($itmGlossary[1]);
  19.     }
  20.  
  21.     // now we sort both arrays together so the keys match, and we do it ASC on the CI one so we get a true alpha sort
  22.     array_multisort($arGlossaryCI,SORT_ASC, SORT_REGULAR,$arGlossary);
  23. ?>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  25. <html>
  26. <head>
  27. <title><?php echo ($sProductNameInformal); ?> Glossary Entries</title>
  28. <?php
  29. require "_styles_import.php";
  30. ?>
  31. </head>
  32.  
  33. <body>
  34. <!--Copyright (c) 2005 Pure Networks Inc.  All rights reserved.-->
  35. <table width="100%" border="0" class="GlossaryTable">
  36. <tr>
  37.     <td valign="top">
  38.         <!--Main Content Starts Here-->
  39.             <?php
  40.                 //now that we have a CI alpha sort, we run through and print the items in the array out.
  41.                 foreach ($arGlossary as $itmGlossary)
  42.                 {
  43.                     $sGlossaryTerm = $itmGlossary[0];
  44.                     $sGlossaryDef  = $itmGlossary[1];
  45.                     echo ("<a name=\"" . urlencode($sGlossaryTerm) . "\"></a>\r\n");
  46.                     echo ("<div class=\"GlossaryItem\">" . $sGlossaryTerm . "</div>\r\n");
  47.                     echo ("<div class=\"GlossaryDefinition\">" . $sGlossaryDef . "</div>\r\n");
  48.                 }
  49.             ?>
  50.         <!-- Main content ends here -->
  51.     </td>
  52. </tr>
  53. </table>
  54. </body>
  55. </html>